package com.hotel.controller.user;

import com.hotel.entity.UserRoom;
import com.hotel.result.Result;
import com.hotel.service.UserRoomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/user/room")
public class UserRoomController {
    @Autowired
    private UserRoomService userRoomService;
    /**
     * 获取房间列表
     */
    @RequestMapping("/list")
    public Result<List<UserRoom>> list(){
          List<UserRoom> userRoomList =  userRoomService.list();
          return Result.success(userRoomList);
    }
}
